package com.starsola.cloud.productserver.controller;

import com.starsola.cloud.productserver.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/product")
public class ProductController {

    @Autowired
    private IProductService productService;

    @RequestMapping("/list")
    public Object list() {
        return productService.list();
    }

    @RequestMapping("/find")
    public Object find(@RequestParam("iid") Long id) {
        return productService.get(id);
    }


}
